<?php
/**
 * Modelo CRUD de noticias
 * @author Wiliame Morais @ PC4 Team
 */
class PC4_Crud_Noticia extends PC4_Crud_NoticiaSimples {
	
	protected $caminho;
	
	function __construct($caminho = '', $tabela = 'noticias', $uploads = array()) {
		$uploads = array_merge($uploads, array('imagem' => array('tamMaximo' => 2048)));
		parent::__construct($caminho, $tabela, $uploads);
	
		$this->caminho = $caminho;
	}
	
	function lista($pagina = 1, $limite = 30, $debug = false){
		$this->db->select($this->letra . '.*, u.id AS idUsuario, u.nome AS nomeUsuario');
		$this->db->join('usuarios u', 'u.id = ' . $this->letra . '.id_usuarios', 'left');
		return parent::lista($pagina, $limite, $debug);
	}
	
}
?>